package com.malty.apimanage.service.impl.inner;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.malty.apimanage.service.UserInfoService;
import com.malty.common.api.InnerUserInfoService;
import com.malty.common.domain.entity.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author malty
 */
@Slf4j
@DubboService
public class InnerUserInfoServiceImpl implements InnerUserInfoService {
    @Autowired
    private UserInfoService userInfoService;
    @Override
    public UserInfo getUser(String accessKey) {
        UserInfo userInfo = new UserInfo();
        userInfo.setAccessToken(accessKey);
        QueryWrapper<UserInfo> wrapper = new QueryWrapper<>(userInfo);
        return userInfoService.getOne(wrapper);
    }
}




